package com.yjhb.android.sbz.mvp.managercenter

import com.yjhb.android.sbz.entity.CheckResult
import com.yjhb.android.sbz.enums.TaskStatus
import com.yjhb.android.sbz.http.HttpObserver
import com.yjhb.android.sbz.http.HttpTool
import com.yjhb.android.sbz.mvp.ConventionPresenter2


/**
 *  创建者 zx
 *  创建时间 2021/3/23 11:41
 */
class RunningTaskUserListPresenter(runningTaskUserView: RunningTaskUserView)
    : ConventionPresenter2<RunningTaskUserView>(runningTaskUserView) {

    fun loadUserList(taskId: Int, size: Int, current: Int) {
        model?.let {
            HttpTool.request(model.auditList(taskId.toString(), TaskStatus.TASK_STATUS_TAKE.status, size, current), object : HttpObserver<MutableList<CheckResult>?>() {
                override fun onResult(data: MutableList<CheckResult>?) {
                    data?.let {
                        view?.onList(it, current == 1)
                    }
                }

                override fun onError(code: Int, msg: String?) {
                    view?.onFailure(code, msg)
                }
            })

        }
    }

}